<?php

/**
 * Description of AddUserForm
 *
 * @author Mina
 */
class RegisterUserForm extends UserForm
{

    public function configure()
    {
        parent::configure();
        $this->useFields(array('username', 'name', 'password', 're_password', 'email', 'phone', 'mobile', 'address', 'photo', 'captcha'));
        $this->addFormatter('CustomFormatter');
    }

    public function doSave($con = null)
    {
        // get default role and assign it to register user
        $role = RoleTable::getInstance()->findDefaultRole();
        $this->getObject()->setStatues(User::ACTIVATED);
        $this->getObject()->setRole($role);
        parent::doSave($con);
    }

}
